﻿//Copyright © Omega Point 2008
//All rights reserved.
//This Software is Licensed under the New BSD License
//for a full copy of this license see http://www.codeplex.com/networkmessenger/license
//Redistributions of source code must retain the above copyright notice.
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using OmegaPoint.Vista.Dwm;

namespace NetworkMessenger
{
    /// <summary>
    /// Interaction logic for StartChatWindow.xaml
    /// </summary>
    public partial class StartChatWindow : Window
    {
        public StartChatWindow()
        {
            InitializeComponent();
            if (Properties.Settings.Default.LastSentTo != null)
            {
                foreach (string host in Properties.Settings.Default.LastSentTo)
                {
                    chatwithComboBox.Items.Add(host);
                }
            }
        }

        public string ChatWith;

        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            if (chatwithComboBox.Text.Replace(" ","").Length > 0)
            {
                 ChatWith = chatwithComboBox.Text;
                Tools.AddToLastRecivers(chatwithComboBox.Text);
                DialogResult = true;
                Close();    
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (Aero.DoesOSSupportDwm() == true)
            {
                try
                {
                    Aero.ExtendGlassFrame(this, new Thickness(-1));
                }
                catch (Exception)
                {
                    //Alter Background to fill area
                    rectBackground.RadiusX = 0;
                    rectBackground.RadiusY = 0;
                    rectBackground.Opacity = 1;
                }
            }
            else
            {
                rectBackground.RadiusX = 0;
                rectBackground.RadiusY = 0;
                rectBackground.Opacity = 1;
            }
        }

    }
}
